﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="NewAccount2.aspx.cs" Inherits="FimetContoDeposito.Authentication.NewAccount2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <asp:PlaceHolder ID="PlaceHolder1" runat="server"> 
        <%: Scripts.Render("~/bundles/JQuery") %>          
        <%: Scripts.Render("~/bundles/JQueryUI") %>                
        <%: Styles.Render("~/bundles/Formly/css") %>
        <%: Scripts.Render("~/bundles/Formly") %>
    </asp:PlaceHolder>
          
    <script type="text/javascript" lang="javascript" src="../Scripts/Formly/FormlyHelper.js"></script>
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.Core.js"></script> 
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.AngularJS.Directives.Fileupload.js"></script> 
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.AngularJS.Directives.DateTimePicker.js"></script> 
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.AngularJS.js"></script> 

    <style>
        body {
        margin: 20px
        }

        .formly-field {
        margin-bottom: 16px;
        }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!-- 
        Sitemap Menu item:
        <siteMapNode url="~/NewAccount2.aspx" title="NewAccount2" description="NewAccount2" image="fa-laptop" id="NewAccount2"/>
    -->
    <section class="panel">
	    <header class="panel-heading">
			<b>Nuovo Account Operatore</b>
		</header>
		<div class="panel-body" ng-app="formlyExample" ng-controller="MainCtrl as vm" id="divFormly" name="divFormly">

            <!-- PUT YOUR CONTENT HERE -->
            <%--<h1>Nuovo Account<br /><hr /></h1>--%>
            <div ng-if="vm.loadingData.$$state.status === 0" style="margin:20px 0;font-size:2em">
                <strong>Loading...</strong>
            </div>
            <div ng-if="vm.loadingData.$$status.state !== 0">
                <form ng-submit="vm.onSubmit()" novalidate id="formlyForm">
                    <formly-form model="vm.model" fields="vm.fields" form="vm.form">
                    <button type="sumbit" class="btn btn-primary submit-button" ng-disabled="vm.form.$invalid">Salva</button>
                    </formly-form>
                </form>
            </div>

		</div>
	</section>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="LocaJavascript" runat="server">
<script type="text/javascript">

    var idToEdit = GetQueryStringParams("id");

    var settings = new FormlySettings();
    settings.container = '#divFormly';
    settings.callbackSuccess = SuccessCallback;

    settings.setLoad(settings.createGetConfig('/api/Customers/LoadFieldsNewCustomer'));
    settings.setSend(settings.createPostConfig('/api/Customers/NewUserCustomer'));

    FormlyManager(settings);

    //
    function SuccessCallback(response) {
        alert(response);
    }

</script>
</asp:Content>